package com.muyu.cloud.commodity.mapper;

import com.muyu.cloud.commodity.domain.model.ProductSku;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @
 * @descriptions: ProductSkuMapper
 * @author: LiuSuo
 * @date: 11:26
 * @version: 1.0
 */
@Mapper
public interface ProductSkuMapper {
    List<String> selectExistingSkuCodesExcludeProduct(@Param("skuCodes") List<String> skuCodes, @Param("productId") Long productId);

    void insert(ProductSku productSku);

    void updateById(ProductSku sku);

    void batchInsert(List<ProductSku> skuList);

    List<ProductSku> selectByProductId(@Param("id") Long id);

    /**
     * 插入SKU并返回主键
     */
    int insertReturnId(ProductSku productSku);

    /**
     * 根据ID查询SKU
     */
    ProductSku selectById(Long id);

    /**
     * 批量根据ID查询SKU
     */
    List<ProductSku> selectBatchIds(List<Long> ids);

}
